/*
  wxTriangulator
  Copyright 2008 Boleslaw Kulbabinski

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include<wx/wx.h>

#include<vector>
#include<string>

using std::vector;
using std::pair;
using std::make_pair;
using std::abs;
using std::string;

class TriWindow : public wxFrame
{
public:
	TriWindow(const wxString& title, const wxPoint& pos, const wxSize& size);

	void OnTriangulate(wxCommandEvent& event);
	void OnClear(wxCommandEvent& event);
	void OnQuit(wxCommandEvent& event);

	void OnPaint(wxPaintEvent& event);
	void OnMouseMove(wxMouseEvent& event);
	void OnMouseLeave(wxMouseEvent& event);
	void OnLeftClick(wxMouseEvent& event);

private:
	bool test_vicinity(Point A, Point B);
	void draw_vertex(wxDC *dc, long x, long y);
	void draw_polygon(wxDC *dc, bool closed);
	void draw_triangulation(wxDC *dc);
};

